package DesignPattern.Behavior.Iterator;

public class Client {
    public static void main(String[] args) {
        StudentAggregateImpl sa = new StudentAggregateImpl();
        sa.addStudent(new Student("张三", "001"));
        sa.addStudent(new Student("李四", "002"));
        sa.addStudent(new Student("王五", "003"));
        sa.addStudent(new Student("赵六", "004"));

        StudentIterator si = sa.getstudentIterator();
        while (si.hasNext()) {
            Student student = si.next();
            System.out.println(student);
        }
    }
}
